package com.xsj.service.impl;

import com.xsj.dto.ResponseDto;
import com.xsj.mapper.AdressMapper;
import com.xsj.pojo.UserAddress;
import com.xsj.service.AdressService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @BelongsProject: fore-phases
 * @BelongsPackage: com.xsj.service.impl
 * @Author: 康思捷
 * @CreateTime: 2025-06-13 15:11
 * @Description: TODO
 * @Version: 1.0
 */
@Service
public class AdressServiceImpl implements AdressService {
    @Autowired
    AdressMapper adressMapper;
    @Override
    public Integer UPAdress(int addressId, double longitude, double latitude, String address, String client, String clientPhone,int clientSex) {
       return adressMapper.UPAdress(addressId, longitude, latitude, address, client, clientPhone,clientSex);
    }

    @Override
    public Integer InitAdress(int userId, double longitude, double latitude, String address, String client, String clientPhone,int clientSex) {
        return adressMapper.InitAdress(userId, longitude, latitude, address, client, clientPhone,clientSex);
    }

    @Override
    public Integer DeAderss(int addressId) {
        return adressMapper.DeAderss(addressId);
    }

    @Override
    public ResponseDto SeAdress(int userId) {
        List<UserAddress> userAddresses = adressMapper.SeAdress(userId);
        return ResponseDto.success(userAddresses);
    }
}
